package com.oglvip.business.dto;

import com.oglvip.business.consts.common.ResponseCode;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @auther hanchao
 * @date 2016/11/27 13:05
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ResponseData<T> {
    private int code;
    private String message;
    private T data;

    public ResponseData setResponseCode(ResponseCode code){
        this.code = code.getCode();
        this.message = code.getInfo();
        return this;
    }

    public T get(){
        return data;
    }


}
